package com.mdxq.first.controller;

import com.mdxq.first.entity.Student;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author WanJl
 * @version 1.0
 * @title StudentController
 * @description
 * @create 2024/11/17
 */
@RestController
public class StudentController {
    @Value("${student.name}")
    private String name;

    @Value("${student.age}")
    private int age;

    @Value("${student.gender}")
    private String gender;

    @GetMapping("/student/queryAll")
    @ResponseBody
    public String method(){
        return "姓名："+name+"，年龄："+age+"，性别："+gender;
    }

    @Resource
    private Student student;

    @GetMapping("/student/queryAllAl")
    @ResponseBody
    public String method02(){
        return student.toString();
    }
}
